import { defineStore } from 'pinia'
import { ref } from 'vue'
import { personalInfo } from '@/data/personal'
import { socialLinks } from '@/data/social'

export const useUserStore = defineStore('user', () => {
  // 个人信息
  const info = ref(personalInfo)
  
  // 社交链接
  const social = ref(socialLinks)
  
  // 更新个人信息
  function updateInfo(newInfo) {
    info.value = { ...info.value, ...newInfo }
  }
  
  return {
    info,
    social,
    updateInfo
  }
})

